package com.gs.cd.service.auth.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.gs.cd.service.auth.model.AuthUserRole;
import com.gs.cd.service.auth.mapper.AuthUserRoleMapper;
import com.gs.cd.service.auth.service.AuthUserRoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author seven
 * @since 2020-12-22
 */
@Service
public class AuthUserRoleServiceImpl extends ServiceImpl<AuthUserRoleMapper, AuthUserRole> implements AuthUserRoleService {

    @Override
    public List<AuthUserRole> listByUserLoginName(String loginName, String tenantCode) {
        return list(new QueryWrapper<AuthUserRole>().lambda()
                .eq(AuthUserRole::getUserLoginName, loginName)
                .eq(AuthUserRole::getTenantCode, tenantCode));
    }
}
